from info import db
from info.constants import QINIU_DOMIN_PREFIX
from info.food_models import Food
from manage import app


# def main():
#     food = Food()
#     food.food_name = "川味粉蒸肉"
#     food.price = "38"
#     food.taste = "家常味"
#     food.cooking_style = "蒸"
#     food.food_image_url = QINIU_DOMIN_PREFIX + "Flb8gAtTaPq8z1GTcGbkJA2SW_TP "
#     food.category_id = 1
#     with app.app_context():
#         db.session.add(food)
#         db.session.commit()
def main():
    food1 = Food(food_name="川味粉蒸肉", price="38", taste="家常味", cooking_style="蒸", category_id=1, food_image_url="http://oyucyko3w.bkt.clouddn.com/Flb8gAtTaPq8z1GTcGbkJA2SW_TP")
    food2 = Food(food_name="辣椒回锅肉", price="", taste="香辣味", cooking_style="炒", category_id=1, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fq_2pxRiskqfM0nc-CB1SyCtG0zQ")
    food3 = Food(food_name="辣子鸡丁", price="29", taste="麻辣味", cooking_style="炒", category_id=1, food_image_url="http://oyucyko3w.bkt.clouddn.com/FmJR_GSIkg6Hg6xcK47oJ62oc0jF")
    food4 = Food(food_name="水煮牛肉", price="48", taste="麻辣味", cooking_style="煮", category_id=1, food_image_url="http://oyucyko3w.bkt.clouddn.com/Flnfsoc1UbX2Dzg0V8haeTz-7pwo")
    food5 = Food(food_name="鱼香肉丝", price="28", taste="酸辣味", cooking_style="炒", category_id=1, food_image_url="http://oyucyko3w.bkt.clouddn.com/FsnsekYxbpvWoQtzFvjjSqvxuudp")
    food6 = Food(food_name="仔姜排骨", price="38", taste="姜香味", cooking_style="炒", category_id=1, food_image_url="http://oyucyko3w.bkt.clouddn.com/FkXMXHEoMT0MSs84E-H-NDNUZALY")
    # cid = 2
    food7 = Food(food_name="剁椒鱼头", price="48", taste="麻辣味", cooking_style="炸", category_id=2, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fp6EMXP44wIt3QKkWFRMReYhGPsW")
    food8 = Food(food_name="农家小炒肉", price="28", taste="家常味", cooking_style="炒", category_id=2, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fq4gFXjQDz3WxVmJbS6uizZAeAzr")
    food9 = Food(food_name="湘乳烧鲈鱼", price="58", taste="咸鲜味", cooking_style="炒", category_id=2, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fmo8tygqLmywQYgOh0gyIeXbR6zH")
    food10 = Food(food_name="湘西土匪鸭", price="48", taste="家常味", cooking_style="焖", category_id=2, food_image_url="http://oyucyko3w.bkt.clouddn.com/FsvaLl9HCxLMl07AYMG_ZM34cKsF")
    food11 = Food(food_name="蒸双腊", price="38", taste="家常味", cooking_style="蒸", category_id=2, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fhv6JMkHxXFP_7SFD1GlGiF-I0AV")
    food12 = Food(food_name="左宗棠鸡翅", price="28", taste="酸甜味", cooking_style="炒", category_id=2, food_image_url="http://oyucyko3w.bkt.clouddn.com/FkJfhCmPGO6pqA6MZgPbVC18IcZC")
    # cid=3
    food13 = Food(food_name="白果腐竹猪肚汤", price="38", taste="咸鲜味", cooking_style="炖", category_id=3, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fk0vYfX0cODO8jtceUnrkQv0rFaW")
    food14 = Food(food_name="白切鸡", price="28", taste="蒜香味", cooking_style="蒸", category_id=3, food_image_url="http://oyucyko3w.bkt.clouddn.com/FugODIszkxLkACUmMqawBS03NJws")
    food15 = Food(food_name="潮汕红壳桃", price="18", taste="甜味", cooking_style="煮", category_id=3, food_image_url="http://oyucyko3w.bkt.clouddn.com/FtW_mBq-7bG03Gp-_9U4ihvN-5gq")
    food16 = Food(food_name="腊味煲仔饭", price="28", taste="家常味", cooking_style="焖", category_id=3, food_image_url="http://oyucyko3w.bkt.clouddn.com/Folc5UqwskHbACdaWV1LbcUxdtFw")
    food17 = Food(food_name="蜜汁叉烧", price="38", taste="甜味", cooking_style="蒸", category_id=3, food_image_url="http://oyucyko3w.bkt.clouddn.com/FiqwvV93QD5t8mmUtMh0otps1MXW")
    food18 = Food(food_name="水晶虾饺", price="18", taste="家常味", cooking_style="蒸", category_id=3, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fn4FE7Mke9cHwZl7tk2B3MpDgkkb")
    # cid=4
    food19 = Food(food_name="拔丝苹果", price="18", taste="甜味", cooking_style="炸", category_id=4, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fm95uvq8XH7wP3_iDashMmugEuP1")
    food20 = Food(food_name="豆角小炒肉", price="28", taste="家常味", cooking_style="炒", category_id=4, food_image_url="http://oyucyko3w.bkt.clouddn.com/FqINIA8pjmZ-84loEIjb7pICq-Cq")
    food21 = Food(food_name="鲫鱼荷包蛋", price="18", taste="家常味", cooking_style="蒸", category_id=4, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fk2A4R7uE19gz8obOpabth405poT")
    food22 = Food(food_name="梅菜肉饼", price="28", taste="家常味", cooking_style="蒸", category_id=4, food_image_url="http://oyucyko3w.bkt.clouddn.com/FkeiXhKHFFOW5lo9UeSp5fNBM7D-")
    food23 = Food(food_name="四喜丸子", price="18", taste="家常味", cooking_style="蒸", category_id=4, food_image_url="http://oyucyko3w.bkt.clouddn.com/FofMHfA66UYnM83EzVrXoS0REs7d")
    food24 = Food(food_name="醉腰丝", price="18", taste="甜味", cooking_style="炒", category_id=4, food_image_url="http://oyucyko3w.bkt.clouddn.com/FtV0ZOKz3ib8EM7mw5YmC_BDJ-xF")
    # cid=5
    food25 = Food(food_name="地山鲜", price="18", taste="家常味", cooking_style="炒", category_id=5, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fra8TaqbkLzDKgKwDmoIBDcQ0jtB")
    food26 = Food(food_name="锅包肉", price="28", taste="家常味", cooking_style="炒", category_id=5, food_image_url="http://oyucyko3w.bkt.clouddn.com/FpGIOga7VLwS7YYzx3oIPtjxaple")
    food27 = Food(food_name="杀猪菜", price="48", taste="家常味", cooking_style="炒", category_id=5, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fqq4jHxaACTih1YrLbhyQTaJw97m")
    food28 = Food(food_name="头菜拌牛肉", price="48", taste="家常味", cooking_style="凉拌", category_id=5, food_image_url="http://oyucyko3w.bkt.clouddn.com/FrYeGXZnZ0JD-tcQeb0FW-3lRFVA")
    food29 = Food(food_name="香炒里脊", price="38", taste="酸甜味", cooking_style="炒", category_id=5, food_image_url="http://oyucyko3w.bkt.clouddn.com/FqwXGB4bmTZMjUMLuyZteG8hFE1t")
    food30 = Food(food_name="孜然酱骨架", price="48", taste="酸辣味", cooking_style="酱", category_id=5, food_image_url="http://oyucyko3w.bkt.clouddn.com/FikP_IUhEGwXS0JZ6aTENvgo-5Yp")
    # cid=6
    food31 = Food(food_name="酢肥肠", price="38", taste="麻辣味", cooking_style="炒", category_id=6, food_image_url="http://oyucyko3w.bkt.clouddn.com/FuTX3_Nu2Y8V_zhd5xyXnTwSz20J")
    food32 = Food(food_name="干烧臭桂鱼", price="38", taste="臭味", cooking_style="炒", category_id=6, food_image_url="http://oyucyko3w.bkt.clouddn.com/FpfsHhL_HM7vP465uIcc_un_OO-w")
    food33 = Food(food_name="藕夹", price="18", taste="家常味", cooking_style="炒", category_id=6, food_image_url="http://oyucyko3w.bkt.clouddn.com/FqCEGnLpZMSnIOaxRB_06VXfuj0m")
    food34 = Food(food_name="皮条鳝鱼", price="48", taste="家常味", cooking_style="炒", category_id=6, food_image_url="http://oyucyko3w.bkt.clouddn.com/FrCzNh1-VKE6C1zd7Wg2jDG1rDEC")
    food35 = Food(food_name="珍珠圆子", price="18", taste="甜味", cooking_style="蒸", category_id=6, food_image_url="http://oyucyko3w.bkt.clouddn.com/FsfZCqRvIxl6RoUWIiKFB1tyZahw")
    food36 = Food(food_name="蒸鱼糕", price="18", taste="家常味", cooking_style="蒸", category_id=6, food_image_url="http://oyucyko3w.bkt.clouddn.com/FvHl5ypXMIHhR9ILXUu8RcLio1Tr")
    # cid=7
    food37 = Food(food_name="东坡肉", price="38", taste="酸甜味", cooking_style="蒸", category_id=7, food_image_url="http://oyucyko3w.bkt.clouddn.com/Fg65acUI1HJz4VA09_bxbY18DWe3")
    food38 = Food(food_name="桂花糯米藕", price="28", taste="甜味", cooking_style="蒸", category_id=7, food_image_url="http://oyucyko3w.bkt.clouddn.com/FhGmEDGmpyaSHnBhHqyIEEkzaxl5")
    food39 = Food(food_name="花雕熏鱼", price="38", taste="家常味", cooking_style="炒", category_id=7, food_image_url="http://oyucyko3w.bkt.clouddn.com/FgRGaT9fft8MqqwFXZl7GEKnmExy")
    food40 = Food(food_name="江南卤鸭", price="38", taste="卤味", cooking_style="卤", category_id=7, food_image_url="http://oyucyko3w.bkt.clouddn.com/FiWtqk3Zzht22bOnVI2HxDX97cOJ")
    food41 = Food(food_name="油爆大虾", price="58", taste="香辣味", cooking_style="焖", category_id=7, food_image_url="http://oyucyko3w.bkt.clouddn.com/FrUddvz4D997HP9u0ZCHGYlVENwi")
    food42 = Food(food_name="油焖春笋", price="18", taste="家常味", cooking_style="炒", category_id=7, food_image_url="http://oyucyko3w.bkt.clouddn.com/FmimbpdAhJJjXBsLdR2M8AKjoHVx")

    with app.app_context():
            db.session.add_all([food1, food2, food3, food4, food5, food6])
            db.session.add_all([food7, food8, food9, food10, food11, food12])
            db.session.add_all([food13, food14, food15, food16, food17, food18])
            db.session.add_all([food19, food20, food21, food22, food23, food24])
            db.session.add_all([food25, food26, food27, food28, food29, food30])
            db.session.add_all([food31, food32, food33, food34, food35, food36])
            db.session.add_all([food37, food38, food39, food40, food41, food42])
            db.session.commit()


if __name__ == '__main__':
    main()